export default {
    data() {
        return {
            query: {
				page:1,
				page_size:10,
			},
            table: {
                data: [],
				total:0
            },
        };
    },
    methods: {
		getAllQuery(){
			var query=this.query
			if(this.params){
				query=Object.assign(query,this.params)
			}
			return query
		},
		onSearch(){
			this.query.page=1
			this.search(this.getAllQuery())
		},
		resetSearch(){
			Object.keys(this.params).forEach(key=>{
				this.params[key]=''
			})
			this.query.page=1
			this.query.page_size=10
			this.search(this.getAllQuery())
		},
		onSizeChange(e){
			this.query.size=e
			this.search(this.getAllQuery())
		},
		onCurrentChange(e){
			this.query.page=e
			this.search(this.getAllQuery())
		}
    },
}
